<?php
?>
<form method="" action="post">
    nama : <input type="text" name="namacustomer" value="<?php echo $namacustomer ?>" />
    no hp : <input type="text" name="nohp" value="<?php echo $nohp ?>">
    <table border="1">
        <tr>
            <th>
                no
            </th>
            <th>
                id item
            </th>
            <th>
                kategori
            </th>
            <th>
                jumlah
            </th>
            <th>
                harga
            </th>
            <th>
                aksi
            </th>
        </tr>
    <?php
    $no = 0;
    $total =0;
    if ($bon != "")
    {
        foreach ($bon as $row) {
            $no++;
                         ?>
            <tr>
                <td>
                    <?php echo $row['id'] ?>
                </td>
                <td>
                    <?php echo $row['kategori'] ?>
                </td>
                <td>
                    <?php echo $row['jumlah'] ?>
                </td>
                <td>
                    <?php echo $row['harga'] ?>
                </td>
                <td>
                    <?php echo $row['aksi'] ?>
                </td>
                <td>
                    <form action="" method="post">
                        <input type="hidden" name="aksi" value="edit" />
                        <input type="hidden" name="no" value="<?php echo ($no-1) ?>" />
                        <input type="submit" value="edit" />
                    </form>
                    <form action="" method="post">
                        <input type="hidden" name="aksi" value="delete" />
                        <input type="hidden" name="no" value="<?php echo ($no-1) ?>" />
                        <input type="submit" value="delete" />
                    </form>
                </td>
            </tr>
            <?php
            $total += $row['harga'];
            }
    }?>
    </table>
    total : <?php echo $total ?><br />
    yang harus dibayar : <input type="text" name="total" value="<?php echo $total ?>">
</form>
<?php
?>
